[[PageOutline(3-4, Sections)]]
== !InsertMovie ==
=== Intro ===
insert a movie into the database
----
=== Description ===
'''struct !InsertMovie(string $token, struct('moviename' => string $moviename, 'movieyear' => string $movieyear) $movieinfo)'''
Allows registered users to insert new movies (not stored in IMDb) to the database.
Guidelines for implementation:
* when loading a movie first try to auto-detect IMDb ID from .NFO files accompanying the release.
* when uploading without IMDb ID user enters a movie title (and year) first call [wiki:XmlRpcSearchMoviesOnIMDB SearchMoviesOnIMDB()].
* If this returns no matches and user checks that the movie doesn't exist on IMDb, allow to insert a new movie using this function.
* this needs to be done to avoid duplicates.
----
=== Parameters ===
{{{
struct(
(string) [token],
struct(
(string) [moviename],
(string) [movieyear]
) [movieinfo]
)
}}}
''token''::
token string identifying user's session, taken from [wiki:XmlRpcLogIn LogIn] output structure.
''movieinfo (required)''::
information about the movie to be inserted containing:
* ''moviename'': movie title
* ''movieyear'': release year
----
=== Return Values ===
Output is returned in this structure:
{{{
struct(
(string) [status],
(string) [id],
(string) [seconds]
)
}}}
and contains these elements:
''status''::
function result code, see [wiki:XmlRpcStatusCode list of status codes]
''id''::
* ID of the newly inserted movie in the database
* you can use it later for uploading subtitles.
''seconds''::
time taken to execute this command on server
----
=== Implementations ===
There are currently no available sample implementations.
----
=== Changelog ===
Version 1: created this function
----
=== Examples ===
==== Input ====
{{{
#!xml
InsertMovie
5ge539v8jsvqimnimtbcefaem1
moviename
Three koalas and the tiger Volume 1
movieyear
2008
}}}
==== Output ====
{{{
#!xml
status
200 OK
id
10000044
seconds
0.018
}}}
----
=== Notes ===
none yet
----
=== See also ===
* [wiki:XmlRpcSearchMoviesOnIMDB SearchMoviesOnIMDB()]
----
=== Comments ===
add your comments, hints and suggestions here if you like ...
--------
[Prev] [wiki:XmlRpcIntro Home] [Next]